﻿namespace Smark.Core
{
    using System;
    using System.Reflection;
    using System.Runtime.CompilerServices;

    public class FieldHandler
    {
        private GetValueHandler mGetValue;
        private SetValueHandler mSetValue;

        public FieldHandler(FieldInfo field)
        {
            this.mGetValue = ReflectionHandlerFactory.FieldGetHandler(field);
            this.mSetValue = ReflectionHandlerFactory.FieldSetHandler(field);
            this.Field = field;
        }

        public FieldInfo Field { get; private set; }

        public GetValueHandler GetValue
        {
            get
            {
                return this.mGetValue;
            }
        }

        public SetValueHandler SetValue
        {
            get
            {
                return this.mSetValue;
            }
        }
    }
}

